<template>
  <div>
    <button v-on:click="fun">点击</button>
    <button @click="fun">点击22</button>
    <button @click="payMoney(100000)">娶媳妇花了100000</button>
    <button @click="payMoney(3000000)">买跑车花了3000000</button>
    <button @click="payMoney(1000000)">买房子首付1000000</button>
    <div style="width:200px; height:200px; border:1px solid green" @click="divClick">
      <button @click="inClick">一个参数</button>
      <button @click="insClick(200,$event)">两个参数</button>
    </div>
  </div>
</template>
<script>
export default {
  name: 'demo-on',
  methods: {
    fun() { 
      console.log('哎呀，被点击啦');
    },
    payMoney(money) { 
console.log(`花了${money}元`);
    },
    divClick() { 
      console.log('div被点击');
    },
    inClick(e) { 
      e.stopPropagation();
     console.log('单个参数被点击');
    },
    insClick(sum,e) { 
      e.stopPropagation();
 console.log(sum);
    }
  }
}
</script>